﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Microsoft.Practices.Unity;
using TypeMock.ArrangeActAssert;
using Core.ScreenStore.ScreenFactory;
using Core.Infrastructure.ScreenManager;
using CThru.Silverlight;

namespace Core.ScreenStore.Test
{
    public class GenericScreenFactoryTests
    {
        [Test, SilverlightUnitTest]
        public void CreateScreen_Always_ScreenFetchedFromContainer()
        {
            IUnityContainer container = Isolate.Fake.Instance<IUnityContainer>();
            GenericScreenFactory<IScreen> store = new GenericScreenFactory<IScreen>(container);

            store.CreateScreen();

            Isolate.Verify.WasCalledWithAnyArguments(() => container.Resolve<IScreen>());
        }
    }
}
